# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=python-wsaccel
pkgver=0.6.4
pkgrel=2
pkgdesc='Accelerator for ws4py and AutobahnPython'
arch=('loong64' 'x86_64')
url='https://github.com/methane/wsaccel'
license=('Apache')
depends=('python')
makedepends=('python-setuptools' 'cython')
checkdepends=('python-pytest')
source=("https://github.com/methane/wsaccel/archive/v$pkgver/$pkgname-$pkgver.tar.gz")
sha512sums=('980364fab8a661c8a2b406f9eb6c99fb5f3a1308bbcf6267fa63f002d8dfbb4a3ad027d83a2088d69324cab05bdc56138d7e66e2602aeb8864dfe49ad9218d07')

build() {
  cd wsaccel-$pkgver
  python setup.py build
}

check() {
  cd wsaccel-$pkgver
  PYTHONPATH="$PWD/build/lib.linux-$CARCH-cpython-311" pytest
}

package() {
  cd wsaccel-$pkgver
  python setup.py install --root="$pkgdir" -O1
}
